//
//  XZGAddressTableViewCell.m
//  mapTest
//
//  Created by xiangzhigang on 16/5/23.
//  Copyright © 2016年 xiangzhi gang. All rights reserved.
//



#import "XZGAddressTableViewCell.h"

#define MAS_SHORTHAND
#define MAS_SHORTHAND_GLOBALS

#import <Masonry/Masonry.h>



@interface XZGAddressTableViewCell ()



@end


@implementation XZGAddressTableViewCell

- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];


}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addSubview:self.adNameLabel];
        [self addSubview:self.adAddressLabel];
        [self addSubview:self.phone_btn];
        [self addSubview:self.location_btn];



    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.adNameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(8);
        make.top.equalTo(self).offset(8);
    }];
    
    [self.adAddressLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(8);
        make.top.equalTo(self.adNameLabel.bottom).offset(8);
    }];
    
    
    [self.phone_btn makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(40);
        make.top.equalTo(self.adAddressLabel.bottom).offset(8);
        make.width.height.equalTo(@30);
        
    }];
    
    [self.location_btn makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.phone_btn).offset(50);
        make.top.equalTo(self.adAddressLabel.bottom).offset(8);
        make.width.height.equalTo(@30);
    }];
    

}


- (UILabel *)adNameLabel {
    if (_adNameLabel == nil) {
        _adNameLabel = [[UILabel alloc] init];
    }
    return _adNameLabel;
}

- (UIButton *)phone_btn {
    if (_phone_btn == nil) {
        _phone_btn = [[UIButton alloc] init];
        [_phone_btn setImage:[UIImage imageNamed:@"chatBar_colorMore_audioCall"] forState:UIControlStateNormal];
        [_phone_btn setImage:[UIImage imageNamed:@"chatBar_colorMore_audioCallSelected"] forState:UIControlStateHighlighted];
    }
    return _phone_btn;
}

- (UIButton *)location_btn {
    if (_location_btn == nil) {
        _location_btn = [[UIButton alloc] init];
        [_location_btn setImage:[UIImage imageNamed:@"chatBar_colorMore_location"] forState:UIControlStateNormal];
        [_location_btn setImage:[UIImage imageNamed:@"chatBar_colorMore_locationSelected"] forState:UIControlStateHighlighted];
    }
    return _location_btn;

    
}


- (UILabel *)adAddressLabel {
    if (_adAddressLabel == nil) {
        _adAddressLabel = [[UILabel alloc] init];
        _adAddressLabel.font = [UIFont systemFontOfSize:13];
        _adAddressLabel.textColor = [UIColor grayColor];
    }
    return _adAddressLabel;
}




@end

